package de.baumann.browser.activitys.hash

import android.content.Context
import android.content.Intent
import android.support.v7.widget.GridLayoutManager
import de.baumann.browser.R
import de.baumann.browser.activitys.H5Activity
import de.baumann.browser.adapter.ImproveHashAdapter
import de.baumann.browser.base.BaseOdinActivity
import de.baumann.browser.base.BasePresenter
import de.baumann.browser.iview.IBaseView
import de.baumann.browser.utils.Constants
import de.baumann.browser.utils.ViewUtil
import kotlinx.android.synthetic.main.activity_improve_hash.*
import kotlinx.android.synthetic.main.include_tool_bar.*

/**
 *@author:
 *@date:2019/7/3 16:39
 *@discription: 提高算力
 */
@Deprecated("过期")
class ImproveHashActivity : BaseOdinActivity<IBaseView, BasePresenter<IBaseView>>() {

    companion object {
        fun startImproveHashActivity(context: Context) {
            context.startActivity(Intent(context, ImproveHashActivity::class.java))
        }
    }

    override fun getLayout(): Int {
        return R.layout.activity_improve_hash
    }

    override fun initView() {
        initToolbar(commToolBar, commTitle)
        rvImproveHash.layoutManager = GridLayoutManager(mContext, 2)
        val improveHashAdapter = ImproveHashAdapter(R.layout.item_improve_hash, ViewUtil.getImproveOptions(mContext))
        rvImproveHash.adapter = improveHashAdapter
        improveHashAdapter.setOnItemClickListener { _, _, position ->
            when (position) {
                0 -> BuyHashActivity.startBuyHashActivity(mContext)
                1 -> InviteActivity.startInviteActivity(mContext)
                2 -> H5Activity.startMallActivity(mContext)
                3 -> H5Activity.startGameActivity(mContext, Constants.GAME2, getString(R.string.game2))
                4 -> H5Activity.startGameActivity(mContext, Constants.GAME1, getString(R.string.game1))
//                5 -> H5Activity.startExchangeActivity(mContext)
            }
        }
    }

    override fun initData() {
    }

    override fun getTitleText(): String {
        return getString(R.string.improve_hash)
    }

    override fun createPresenter(): BasePresenter<IBaseView>? {
        return null
    }

    override fun createView(): IBaseView? {
        return null
    }

}
